package com.empire.module.sporttery.controller.app.football.vo;

import com.empire.module.sporttery.util.SportteryUtils;
import com.empire.module.sporttery.vo.OddsVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "用户 APP - 竞猜足彩比赛投注 Response VO")
@Data
public class AppTouzhuFootballMatchRespVO {

    @Schema(description ="主键id")
    private Integer id;

    @Schema(description ="编号")
    private String number;

    @Schema(description ="500万游戏编号")
    private String matchId;

    @Schema(description ="赛事")
    private String matchs;

    @Schema(description ="颜色")
    private String color;

    @Schema(description ="开赛时间")
    private String openTime;

    @Schema(description ="总进球赔率")
    private String goalOdds;

    @Schema(description ="让球赔率")
    private String letOdds;

    @Schema(description ="半全场赔率")
    private String halfWholeOdds;

    @Schema(description ="不让球赔率")
    private String notLetOdds;

    @Schema(description ="比分赔率")
    private String scoreOdds;

    @Schema(description ="让球")
    private String letBall;

    @Schema(description ="主队")
    private String homeTeam;

    @Schema(description ="下注状态 0 不可下注 1 可下注 2 已取消")
    private String state;

    @Schema(description ="客队")
    private String visitingTeam;

    @Schema(description ="是否单关 0 否 1 是")
    private String isSingle;

    @Schema(description ="比赛下注截止时间")
    private LocalDateTime deadline;

    @Schema(description = "半全场结果")
    private String halfFullCourt;

    @Schema(description = "开奖结果")
    private String award;

    @Schema(description ="属于哪天的比赛时间")
    private String startTime;

    @Schema(description ="胜赔率")
    private OddsVO s;
    @Schema(description ="平赔率")
    private OddsVO p;
    @Schema(description ="负赔率")
    private OddsVO f;
    @Schema(description ="让胜赔率")
    private OddsVO rs;
    @Schema(description ="让平赔率")
    private OddsVO rp;
    @Schema(description ="让负赔率")
    private OddsVO rf;

    @Schema(description ="胜胜")
    private OddsVO ss;
    @Schema(description ="胜平")
    private OddsVO sp;
    @Schema(description ="胜负")
    private OddsVO sf;
    @Schema(description ="平胜")
    private OddsVO ps;
    @Schema(description ="平平")
    private OddsVO pp;
    @Schema(description ="平负")
    private OddsVO pf;
    @Schema(description ="负胜")
    private OddsVO fs;
    @Schema(description ="负平")
    private OddsVO fp;
    @Schema(description ="负负")
    private OddsVO ff;

    @Schema(description ="0球")
    private OddsVO s0;
    @Schema(description ="1球")
    private OddsVO s1;
    @Schema(description ="2球")
    private OddsVO s2;
    @Schema(description ="3球")
    private OddsVO s3;
    @Schema(description ="4球")
    private OddsVO s4;
    @Schema(description ="5球")
    private OddsVO s5;
    @Schema(description ="6球")
    private OddsVO s6;
    @Schema(description ="7+球")
    private OddsVO s7;



    /**
     * 分解让球胜平负的赔率
     */
    public void setLetOdds(String letOdds){
        this.letOdds = letOdds;
        List<OddsVO> os = SportteryUtils.getSPFOddsVO(letOdds);
        if(!os.isEmpty()) {
            this.rs = os.get(0);
            this.rp = os.get(1);
            this.rf = os.get(2);
        }
    }
    /**
     * 分解让球胜平负的赔率
     */
    public void setNotLetOdds(String notLetOdds){
        this.notLetOdds = notLetOdds;
        List<OddsVO> os = SportteryUtils.getSPFOddsVO(notLetOdds);
        if(!os.isEmpty()){
            this.s = os.get(0);
            this.p = os.get(1);
            this.f = os.get(2);
        }

    }
    /**
     * 分解半全场的赔率
     */
    public void setHalfWholeOdds(String halfWholeOdds){
        this.halfWholeOdds = halfWholeOdds;
        List<OddsVO> os = SportteryUtils.getHHDFOddsVO(halfWholeOdds);
        if(!os.isEmpty()){
            this.ss = os.get(0);
            this.sp = os.get(1);
            this.sf = os.get(2);
            this.ps = os.get(3);
            this.pp = os.get(4);
            this.pf = os.get(5);
            this.fs = os.get(6);
            this.fp = os.get(7);
            this.ff = os.get(8);
        }
    }
    /**
     * 分解总进球的赔率
     */
    public void setGoalOdds(String goalOdds){
        this.goalOdds = goalOdds;
        List<OddsVO> os = SportteryUtils.getTTGOddsVO(goalOdds);
        if(!os.isEmpty()){
            this.s0 = os.get(0);
            this.s1 = os.get(1);
            this.s2 = os.get(2);
            this.s3 = os.get(3);
            this.s4 = os.get(4);
            this.s5 = os.get(5);
            this.s6 = os.get(6);
            this.s7 = os.get(7);
        }
    }


}